# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
# Contributor: Jan de Groot <jgc@archlinux.org>
# Contributor: Sarah Hay <sarahhay@mb.sympatico.ca>

pkgname=libgsf
pkgver=1.14.51
pkgrel=1
pkgdesc="Extensible I/O abstraction library for dealing with structured file formats"
url="https://gitlab.gnome.org/GNOME/libgsf"
arch=(loong64 x86_64)
license=(
  GPL
  LGPL
)
depends=(
  bzip2
  gdk-pixbuf2
  libxml2
)
makedepends=(
  autoconf-archive
  git
  gobject-introspection
  gtk-doc
)
checkdepends=(
  perl-xml-parser
  unzip
  valgrind
)
provides=(libgsf-1.so)
_commit=068a3a6da775c1a70fa43b2334b1b06afc2cf8ab  # tags/LIBGSF_1_14_51^0
source=("git+https://gitlab.gnome.org/GNOME/libgsf.git#commit=$_commit")
b2sums=('SKIP')

pkgver() {
  cd libgsf
  git describe --tags | sed 's/^LIBGSF_//;s/_/./g;s/[^-]*-g/r&/;s/-/+/g'
}

prepare() {
  cd libgsf
  NOCONFIGURE=1 ./autogen.sh
}

build() {
  local configure_options=(
    --prefix=/usr
    --sysconfdir=/etc
    --localstatedir=/var
    --disable-static
    --enable-introspection
    --enable-gtk-doc
  )

  cd libgsf
  ./configure "${configure_options[@]}"
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
  make
}

check() {
  cd libgsf
  make check
}

package_libgsf() {
  cd libgsf
  make DESTDIR="$pkgdir" install
}

# vim:set sw=2 sts=-1 et:
